package com.xyht.sca_s.student_manage_system.modules.patrol.controller;


import com.xyht.sca_s.student_manage_system.common.commonReturn.ResponseResult;
import com.xyht.sca_s.student_manage_system.common.desEncodeAndDecode.annotation.SecretBody;
import com.xyht.sca_s.student_manage_system.modules.patrol.entity.vo.SmsPatrolPeopleVO;
import com.xyht.sca_s.student_manage_system.modules.patrol.service.SmsPatrolPeopleService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author XYHT
 * @since 2023-04-16
 */
@RestController
@SecretBody
@RequestMapping("/patrol/smsPatrolPeople")
public class SmsPatrolPeopleController {
    @Autowired
    SmsPatrolPeopleService smsPatrolPeopleService;
    @ApiOperation("新增巡查人")
    @PostMapping("/smsPatrolPeopleAdd")
    public ResponseResult smsPatrolPeopleAdd(@RequestBody SmsPatrolPeopleVO smsPatrolPeople) {
        return smsPatrolPeopleService.smsPatrolPeopleAdd(smsPatrolPeople);
    }
    @ApiOperation("删除巡查人")
    @DeleteMapping("/deleteSmsPatrolPeople")
    public ResponseResult deleteSmsPatrolPeople(@RequestBody SmsPatrolPeopleVO smsPatrolPeople){
        return smsPatrolPeopleService.deleteSmsPatrolPeople(smsPatrolPeople);
    }
    @ApiOperation("修改巡查人")
    @PostMapping("/updateSmsPatrolPeople")
    public ResponseResult updateSmsPatrolPeople(@RequestBody SmsPatrolPeopleVO smsPatrolPeople){
        return smsPatrolPeopleService.updateSmsPatrolPeople(smsPatrolPeople);
    }
    @ApiOperation("查询巡查人列表")
    @GetMapping("/selectSmsPatrolPeople")
    public ResponseResult selectSmsPatrolPeople(@RequestParam(value = "search_str", required = false) String search_str,
                                                @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
                                                @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                                                @RequestParam(value = "bg_date", required = false) String bg_date,
                                                @RequestParam(value = "end_date", required = false) String end_date) {
        return smsPatrolPeopleService.selectSmsPatrolPeople(search_str, pageSize, pageNum, bg_date, end_date);
    }
    @ApiOperation("后台查询巡查人巡查记录")
    @GetMapping("/selectSmsPatrolPeoplePatrolRecord")
    public ResponseResult selectSmsPatrolPeoplePatrolRecord(@RequestParam(value = "search_str", required = false) String search_str,
                                                            @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
                                                            @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                                                            @RequestParam(value = "bg_date", required = false) String bg_date,
                                                            @RequestParam(value = "end_date", required = false) String end_date,
                                                            @RequestParam(value = "patrol_classes", required = false) String patrol_classes,
                                                            @RequestParam(value = "name_of_inspection_point", required = false) String name_of_inspection_point)
    {
    return smsPatrolPeopleService.selectSmsPatrolPeoplePatrolRecord(search_str,pageSize,pageNum,bg_date,end_date,patrol_classes,name_of_inspection_point);
    }

}

